<template>
  <div>
<a href="#/one" >第一页</a>
<a href="#/two">第二页</a>
<a href="#/three">第三页</a>
<button @click="goOne">11</button>
    <router-view></router-view>
    
  </div>
</template>
<!-- 
在配置路由时，给配置规则加上name属性
const router = new VueRouter({
  //路由规则, 一个对象
  routes: [
    { path: '/one', component: PageOne },
    { path: '/two', component: PageTwo },
    { path: '/three', component: PageThree }
  ]
})
===================================================>
const router = new VueRouter({
  //路由规则, 一个对象
  routes: [
    { name="pageone  path: '/one', component: PageOne },
    { name="pagetwo   path: '/two', component: PageTwo },
    { name="pagethree   path: '/three', component: PageThree }
  ]
})




-->
<script>
export default {
  methods: {
   goOne(){
    // 跳转的路径
    this.$router.push('/one')
    //使用name属性跳转时：
    //this.$router.push({name:"pageone"})
   }
  }
}
</script>

<style>

</style>